﻿using System;
using System.Collections.Generic;
using Pay.DTO;

namespace Pay.IService {
	public interface IRegionService {
		IEnumerable<region_dto> Get();
        IEnumerable<region_dto> Gets();
        IEnumerable<region_dto> Get(IEnumerable<long> ids);
		/// <summary>
		/// 查询子类、将子类放在children中
		/// </summary>
		/// <returns>The all.</returns>
		/// <param name="sort">排序：0省按id,1省到首字母.</param>
		/// <param name="read_depth">读到哪一层.</param>
		/// <param name="filer_txah">过滤港澳台海</param>
		IEnumerable<region_dto> GetAll(int sort = 0, int read_depth = -1, bool filer_txah = true);
		/// <summary>
		/// 查询区域的所有上级（N），包括本身
		/// </summary>
		/// <param name="id"></param>
		/// <returns></returns>
		IEnumerable<region_dto> GetParents(long id);
		/// <summary>
		/// 查询子类
		/// </summary>
		/// <param name="id"></param>
		/// <returns></returns>
		IEnumerable<region_dto> GetByParentId(long id);
		region_dto Get(long id);
		/// <summary>
		/// 查询省市区ID
		/// </summary>
		/// <param name="region_id"></param>
		/// <returns></returns>
		long[] GetRegionIds(long region_id);
		/// <summary>
		/// 查询省市区名称，以" "隔开
		/// </summary>
		/// <param name="region_id"></param>
		/// <returns></returns>
		string GetRegionNames(long region_id);
		int Add(region_dto dto);
		int Add(List<region_dto> dto);
		int Update(region_dto dto);
		void ExportAreaCode(string areaName, string areaCode);
		string GetAreaCode(string region_name);
	}
}
